package com.googlecode.ppcool.common;

import java.util.Arrays;

public class Peer {

	private Peer parentPeer;

	private byte[] peerId;
	private long innerIp;
	private int innerPort;
	private long outIp;
	private int outPort;

	public byte[] getPeerId() {
		return peerId;
	}

	public void setPeerId(byte[] peerId) {
		this.peerId = peerId;
	}

	public long getInnerIp() {
		return innerIp;
	}

	public void setInnerIp(long innerIp) {
		this.innerIp = innerIp;
	}

	public int getInnerPort() {
		return innerPort;
	}

	public void setInnerPort(int innerPort) {
		this.innerPort = innerPort;
	}

	public long getOutIp() {
		return outIp;
	}

	public void setOutIp(long outIp) {
		this.outIp = outIp;
	}

	public int getOutPort() {
		return outPort;
	}

	public void setOutPort(int outPort) {
		this.outPort = outPort;
	}

	public Peer getParentPeer() {
		return parentPeer;
	}

	public void setParentPeer(Peer parentPeer) {
		this.parentPeer = parentPeer;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Arrays.hashCode(peerId);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Peer other = (Peer) obj;
		if (!Arrays.equals(peerId, other.peerId))
			return false;
		return true;
	}

}
